#pragma once
#include "VideoInf.h"
#include<memory>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavutil/opt.h>
#include <libavutil/imgutils.h>
#include <libswscale/swscale.h>
}

class CNet;

class RPCFW_EXPORT CVideoEncoder :public EncoderInf
{
public:
	CVideoEncoder();
	bool init(const int width,const int height) override;
	int sendFrame(const AVFrame *) override;
	int recvPacket(AVPacket**) override;

private:
	AVCodecContext *m_pCodecContext = NULL;
	const AVCodec *m_pCodec;
	AVPacket *m_pPkt=nullptr;
};